Dim di As New IO.DirectoryInfo("C:\Inetpub\wwwroot\images")
Dim aryFi As IO.FileInfo() = di.GetFiles("*.JPG")
For Each fi In aryFi
Dim imagname As String = fi.Name
Dim path As String = "http:\\192.168.52.36\images\" & fi.Name
Try
con.Open()
Dim sqlquery As String = "insert into tbl_images values('" & imagname & "','" & path & "')"
Dim sqlcommand As New SqlCommand(sqlquery, con)
sqlcommand.ExecuteNonQuery()
con.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
by this way i am saving images path in database....... like http:\\192.168.52.36\images\img1.jpg.. now i want to display the images in to a control like datagridview taking the images path from database... this is window based appplication..... plz any idea to go forward.. help me out.....
thanks
priya...
Dim aryFi As IO.FileInfo() = di.GetFiles("*.JPG")
For Each fi In aryFi
Dim imagname As String = fi.Name
Dim path As String = "http:\\192.168.52.36\images\" & fi.Name
Try
con.Open()
Dim sqlquery As String = "insert into tbl_images values('" & imagname & "','" & path & "')"
Dim sqlcommand As New SqlCommand(sqlquery, con)
sqlcommand.ExecuteNonQuery()
con.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Next
by this way i am saving images path in database....... like http:\\192.168.52.36\images\img1.jpg.. now i want to display the images in to a control like datagridview taking the images path from database... this is window based appplication..... plz any idea to go forward.. help me out.....
thanks
priya...
Anonymous User
13-Oct-2011The above link is useful for me.
James Smith
03-Aug-2011Hi Priya,
First thing, This is not the perfect place to ask a question or discussing any topic. Here you can submit only blogs. If you want to ask any question then Please join mindstick forum at the following link
Here you can put the appropriate type and then ask your question or you can start a new topic or discussion.
The answer of your question
Here I am writing a few steps which might be helpful for you while solving your problem.
>>Create a SqlConnection object.
>>Create a SqlDataAdapter object.
>>Create a DataSet object.
>>Fill records of the table into DataSet.
Now by doing these steps, all the info comes in your dataset. Now you can easily bind information in DataGridView by making some changes.
>>Make a column of DataGridView of type Image in which you want to show an image.
>>Bind info of DataSet in DataGridView.
You can take the following link for help.
http://msdn.microsoft.com/en-us/library/bxt3k60s.aspx
http://msdn.microsoft.com/en-us/library/2ab8kd75.aspx#Y195
Thanks.
James Smith
03-Aug-2011Hi Priya,
This is not the perfect place to ask a question or discussing any topic. Here you can submit only blogs. If you want to ask any question then Please join mindstick forum at following link